package com.mypj.base.common.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegExUtil {

    public static String getSubByRegEx(String str, String regex) {
        Pattern p = Pattern.compile(regex);
        Matcher m = p.matcher(str);
        while (m.find()) {
            return m.group();
        }
        return "";
    }
}
